import request from '@/utils/request'

export function transferItem(id) {
  return request({
    url: '/vocabulary-item/transferItem/'+id,
    method: 'put',
  })
}


// 查询词汇原型列表
export function listItem(query) {
  return request({
    url: '/vocabulary-item/list',
    method: 'get',
    params: query
  })
}

// 查询词汇原型详细
export function getItem(id) {
  return request({
    url: '/vocabulary-item/' + id,
    method: 'get'
  })
}

// 新增词汇原型
export function addItem(data) {
  return request({
    url: '/vocabulary-item',
    method: 'post',
    data: data
  })
}

// 修改词汇原型
export function updateItem(data) {
  return request({
    url: '/vocabulary-item',
    method: 'put',
    data: data
  })
}


export function turnExampleByWordId(data) {
  return request({
    url: '/vocabulary-item/example',
    method: 'put',
    data: data
  })
}


export function turnExamplesByBankId(data) {
  return request({
    url: '/vocabulary-item/transfer',
    method: 'put',
    data: data
  })
}


// 删除词汇原型
export function delItem(id) {
  return request({
    url: '/vocabulary-item/' + id,
    method: 'delete'
  })
}
